#ifndef MYGRAPHICSVIEW_H
#define MYGRAPHICSVIEW_H

#include <QGraphicsView>
#include "dwgobjectitem.h"

class MyGraphicsView : public QGraphicsView
{
    Q_OBJECT
public:
    MyGraphicsView(QWidget *parrent = nullptr);

    DrawType mCurDrawType = DNone;
    ModifyType mCurModifyType = MNone;
    int myCurLineWidth = 0;
    Qt::PenStyle myCurPenStyle = Qt::SolidLine;
    QColor myCurColor=Qt::black;

    QPointF temppt;
    bool isFirst = true;

    QPointF temppt2;
    bool isSecond = true; // 最好使用QList<QPointF>，由于时间原因，暴力地创造第二个临时点

    // QWidget interface
private:
    QTransform m_trans;
protected:
    virtual void mouseMoveEvent(QMouseEvent *event) override;

    // QWidget interface
protected:
    virtual void mousePressEvent(QMouseEvent *event) override;
    virtual void mouseReleaseEvent(QMouseEvent *event) override;

    // QWidget interface
protected:
    virtual void wheelEvent(QWheelEvent *event) override;

    // QWidget interface
};

#endif // MYGRAPHICSVIEW_H
